<?php
/**
 * @package	minBot
 * @author	Martin Sadový <sodae@email.cz>
 * @copyright   2009 Martin Sadový
 */

abstract class Plugin extends Object
{
    public $onMessage;

    public $onEvent;

    public $onShutdown;

    private $base;

    public function __construct(minBot $base)
    {
        $this->base = $base;
        $this->startup();
    }

    public function startup()
    {
        $this->onMessage = array($this, 'getMessage');
        $this->onEvent   = array($this, 'onEvent');
    }

    /**
    * Send Message
    * @param string $message
    * @param string $to
    */
    protected function sendMessage($message, $to = NULL)
    {
        $this->base->sendMessage($message, $to);
    }


    /**
     * Get instance of NetteBot
     * @return minBot
     */
    protected function getBase()
    {
        return $this->base;
    }

    public function onEvent($type, $data)
    {}

    public function getMessage(Message $message)
    {}

}

?>